
Version:=2.1.1
ModuleName:=Heartbeat

Objcet:=$(ModuleName).tgz
ObjectDir:=$(ModuleName)-Dev*
ObjcetSource:=$(ModuleName)-$(Version).tar.bz2

DependFiles:=

InstallDirTmp:=usr/local
InstallDir:=/$(InstallDirTmp)
InstallLib:=$(InstallDirTmp)/lib

Config:=./configure  --prefix=$(InstallDir) --mandir=/tmp --docdir=/tmp \
	--with-ccmuser-id=0 --with-ccmuser-name=root --with-group-id=0 --with-group-name=root 

Patch:= 

.PHONY: all clean dist_clean

null:

all:$(Objcet) 

$(Objcet):$(ObjcetSource) ha.cf authkeys haresources
	tar -xjf $(ObjcetSource)
	$(Patch)
	cd $(ObjectDir) && ./autogen.sh ; ./bootstrap ;  $(Config)
	$(MAKE) -C $(ObjectDir) 
	$(MAKE) -C $(ObjectDir) install DESTDIR=`pwd`/
	if [ ! -d $(InstallLib) ]; then mkdir -p $(InstallLib); fi
	cp -afr /usr/lib/libglib-2.0.so.* /usr/lib/libltdl.so.* \
	 	$(InstallLib)
	mkdir -p etc/ha.d && cp -rf ha.cf authkeys haresources etc/ha.d 
	$(g_STRIP)
	tar -czf $(Objcet) usr etc

patch:
	mv $(ObjectDir) $(ObjectDir).new
	tar xzvf $(ObjcetSource)
	diff -Nur $(ObjectDir) $(ObjectDir).new > ntop-3.3.patch

clean:
	rm -rf usr $(Objcet) Heartbeat-Dev-* etc tmp

dist_clean:clean
	rm -rf $(ObjectDir) $(ObjcetSource) *.tar.gz *.new *.bz2
	
include ../Makefile.Res
